home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Nov 89 / 0068-Dim Highlight Update-Nov89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.9 KB  |  90 lines  |  [TEXT/GEOL]

  1. Item    6003814                         9-Nov-89        11:11
  2.  
  3. From:   D2086                           Efficient Field Svc, C Faith,PRT
  4.  
  5. To:     D1950                           CSG, Don Phillips,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Dim Highlight Update
  10.  
  11. George,
  12.  
  13. The last Dim code I gave you did not work for updates when the fromHL was
  14. hlOFF and toHL was hlDim.
  15.  
  16. This works for all 9 possibilities.
  17.  
  18. PROCEDURE TMyGridView.HighlightCells(theCells: RgnHandle; fromHL, toHL:
  19. HLState); OVERRIDE;
  20.  
  21.    PROCEDURE DoDrawCell(aCell: GridCell);
  22.    VAR
  23.    aRect:  VRect;
  24.    aQDRect:Rect;
  25.  
  26.    BEGIN
  27.    CellToVRect(aCell,aRect);
  28.    ViewToQDRect(aRect,aQDRect);
  29.    InsetRect(aQDRect,fColInset,fRowInset);
  30.    DrawCell(aCell,aQDRect);
  31.    END;
  32.  
  33.    BEGIN
  34.    IF (fromHL <> toHL) THEN
  35.    BEGIN
  36.    CellsToPixels(theCells, pPixelsToHighlight);
  37.    IF Focus THEN
  38.    BEGIN
  39.    IF fromHL = hlON THEN
  40.    BEGIN
  41.    IF toHL = hlOFF THEN
  42.    BEGIN
  43.    PenNormal;
  44.    UseSelectionColor;
  45.    InvertRgn(pPixelsToHighlight);  { highlight the cells }
  46.    END
  47.    ELSE IF toHL = hlDim THEN
  48.    BEGIN
  49.    PenPat(gray);
  50.    PenMode(patBic);
  51.    PaintRgn(pPixelsToHighlight);   { dim the cells }
  52.    END;
  53.    END { fromHL is hlON }
  54.    ELSE IF fromHL = hlDim THEN
  55.    BEGIN
  56.    PenPat(white);
  57.    PenMode(patCopy);
  58.    PaintRgn(pPixelsToHighlight);   { blank out the cells }
  59.  
  60.    EachSelectedCellDo(DoDrawCell); { redraw the cells }
  61.  
  62.    IF toHL = hlON THEN
  63.    BEGIN
  64.    PenNormal;
  65.    UseSelectionColor;
  66.    InvertRgn(pPixelsToHighlight);  { highlight the cells }
  67.    END;
  68.    END { fromHL is hlDim }
  69.    ELSE
  70.    BEGIN { fromHL is hlOFF }
  71.    PenNormal;
  72.    UseSelectionColor;
  73.    InvertRgn(pPixelsToHighlight);  { highlight the cells }
  74.  
  75.    IF toHL = hlDim THEN
  76.    BEGIN
  77.    PenPat(gray);
  78.    PenMode(patBic);
  79.    PaintRgn(pPixelsToHighlight);   { dim the cells }
  80.    END;
  81.    END; { fromHL is hlOFF }
  82.    END; { IF Focus }
  83.    END;
  84.    END;
  85.  
  86. Yours,
  87.  
  88. Curtis
  89.  
  90.